<?php
$string ="doumoina kely manka kely";
$string = chunk_split(base64_encode($string), 64, "\n");
echo "<br />".$string;
echo "<br />".base64url_decode($string);
echo "<br />".base64url_decode("cm1pamFuaXJpbmFAeWFob28uZnI=");


function base64url_decode($plainText) {
    $base64url = strtr($plainText, '-_,', '+/=');
    $base64 = base64_decode($base64url);
    return $base64;  
}

?>